#include <iostream>
#include <map>

typedef std::map<std::string, int> TestMap;
typedef TestMap::iterator TestMapIter;
typedef TestMap::value_type TestMapVal;

int main(int argc, char *argv[])
{
	TestMap test;
	test.insert({"a", 1});
	std::pair<TestMapIter, bool> res = test.insert(TestMapVal("b", 2));
	test.insert({"c", 3});
	test.insert({"d", 4});
	test.insert({"e", 5});

	for (auto it = test.begin(); it != test.end(); )
	{
		std::cout << it->first << ":" << it->second<< std::endl;	
		if (it->second != 6) {
			std::cout << "erase > " << it->first << ":" << it->second<< std::endl;	
			it = test.erase(it);
		}
	}
	return 0;
}

